package com.pdg.mcplugin.tfbal;

import org.bukkit.plugin.PluginManager;

import com.pdg.mcplugin.common.baseclasses.PluginBase;

public class TFBAL extends PluginBase {
	
	private ConfigurationManager configurationManager = null;
	public ConfigurationManager getConfigurationManager(){
		if(configurationManager == null){
			configurationManager = new ConfigurationManager(this);
		}
		return configurationManager;
	}
	
	private TFBALEventListener eventListener = null;
	public TFBALEventListener getEventListener() {
		if(eventListener==null){
			eventListener = new TFBALEventListener(this);
		}
		return eventListener;
	}

	private PluginManager pluginManager;
	public PluginManager getPluginManager(){
		if(pluginManager==null){
			pluginManager = getServer().getPluginManager();
		}
		return pluginManager;
	}
	
	private PermissionChecker permissionChecker = null;
	public PermissionChecker getPermissionChecker(){
		if(permissionChecker==null){
			permissionChecker = new PermissionChecker(this);
		}
		return permissionChecker;
	}
	
	@Override
	protected void disablePlugin() {
	}

	@Override
	protected boolean enablePlugin() {
		saveDefaultConfig();
		getPluginManager().registerEvents(getEventListener(), this);
		return true;
	}


}
